<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>

<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/demo/demo.css">
<script type="text/javascript" src="<%=basePath%>jslib//easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>jslib/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>jslib/easyui/locale/easyui-lang-zh_CN.js"></script>

<title>Basic PropertyGrid - jQuery EasyUI Demo(1.5.3)</title>

<script type="text/javascript">
		
	$(function(){
		
	});
	
</script>
</head>
<body>

<h2>基本属性表格</h2>
	<div class="demo-info">
		<div class="demo-tip icon-tip"></div>
		<div>点击行来改变每个属性值.</div>
	</div>
	<div style="margin:10px 0;">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="showGroup()">显示分组</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideGroup()">隐藏分组</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="showHeader()">显示头部</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideHeader()">隐藏头部</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="getChanges()">获取变化</a>
	</div>
	<table id="pg" class="easyui-propertygrid" style="width:300px"
			data-options="url:'./propertygrid_data1.json',showGroup:true,scrollbarSize:0"></table>

	<script type="text/javascript">
		function showGroup(){
			$('#pg').propertygrid({
				showGroup:true
			});
		}
		function hideGroup(){
			$('#pg').propertygrid({
				showGroup:false
			});
		}
		function showHeader(){
			$('#pg').propertygrid({
				showHeader:true
			});
		}
		function hideHeader(){
			$('#pg').propertygrid({
				showHeader:false
			});
		}
		function getChanges(){
			var s = '';
			var rows = $('#pg').propertygrid('getChanges');
			for(var i=0; i<rows.length; i++){
				s += rows[i].name + ':' + rows[i].value + ',';
			}
			alert(s)
		}
	</script>
	
	<script type="text/javascript">
	
	</script>
</body>
</html>